import request from "@/utils/request";

// 获取字典类型数据
export const getTypeList = (queryParams: any) => {
    return request({
        url: "/api/v1/dict/types/page",
        method: "get",
        params: queryParams
    })
}

// 字典类型添加
export const addTypeList = (data: any) => {
    return request({
        url: "/api/v1/dict/types",
        method: "post",
        data: data,
    })
}

// 字典类型删除
export const delTypeList = (ids: any) => {
    return request({
        url: "/api/v1/dict/types/" + ids,
        method: "delete",
    })
}

// 字典类型修改
export const updateTypeList = (id: any, data: any) => {
    return request({
        url: "/api/v1/dict/types/" + id,
        method: "put",
        data: data,
    })
}
// 获取字典类型回显
export const getTypeBack = (id: any) => {
    return request({
        url: "/api/v1/dict/types/" + id + "/form",
        method: "get",
    })
}



// 获取字典具体数据
export const getList = (queryParams: any) => {
    return request({
        url: "/api/v1/dict/page",
        method: "get",
        params: queryParams,
    })
}

// 获取表单回显
export const getBack = (id: any) => {
    return request({
        url: "/api/v1/dict/" + id + "/form",
        method: "get",
    });
}

// 添加
export const addList = (data: any) => {
    return request({
        url: "/api/v1/dict",
        method: "post",
        data: data,
    });
}

// 修改字典
export const updateList = (id: any, data: any) => {
    return request({
        url: "/api/v1/dict/" + id,
        method: "put",
        data: data,
    });
}

// 删除字典
export const delList = (ids: any) => {
    return request({
        url: "/api/v1/dict/" + ids,
        method: "delete",
    });
}